package ch.sv7.tool.dbmanager.db.fixbuilder;

import ch.sv7.tool.dbmanager.Context;
import ch.sv7.tool.dbmanager.db.dialect.Dialect;
import ch.sv7.tool.dbmanager.db.difference.ExtraIndexDifference;
import ch.sv7.tool.dbmanager.db.difference.SchemaDifference;
import ch.sv7.tool.dbmanager.db.fix.DropIndexFix;
import ch.sv7.tool.dbmanager.db.fix.SchemaFix;

/**
 * TODO: Document me!
 *
 * @author svt
 *
 */
public class ExtraIndexFixBuilder implements FixBuilder {

	public SchemaFix[] createFixes(SchemaDifference difference, Dialect dialect, Context context) {
		ExtraIndexDifference extraIndexDifference = (ExtraIndexDifference)difference;
		SchemaFix fix = new DropIndexFix(extraIndexDifference.getIndex());
		return new SchemaFix[]{ fix };
	}

}
